<?php
namespace app\agent\model;
use think\Model;
use app\common\model\Area;
/*
**代理模块商户类
*/
class Shops extends Model
{
    protected $pk = 'sp_id';

    /**
     * 关联area 导出excel
     * @return $this
     */
    public function excel(){
        return $this->belongsTo('app\common\model\Area','sp_area_id','id')->field('merger_name,id');
    }

    public function scopeEmail($query, $email)
    {
        $query->where('email', 'like', '%' . $email . '%');
    }
}
?>